<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="bean" uri="struts-bean" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
<%try{%>

<%@page import="com.mastercard.assets.web.util.to.UserLogin"%><link rel="stylesheet" type="text/css" href="JSCal2/css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="JSCal2/css/border-radius.css" />
<script type="text/javascript" src="JSCal2/js/jscal2.js"></script>
<script type="text/javascript" src="JSCal2/js/lang/es.js"></script>
<div id="calendar-container" style="display: none;"></div>
<div id="calendar-info" style="text-align: center; margin-top: 0.3em"></div>
					<div id="bodyContent">
						<h1>Edit Task</h1>
						
						<html:form action='/TareasAgregarRegistrar' method='post' styleId="FormaAgregar">
						<html:hidden property="cveTarea" />
						<html:hidden property="cveFlujo" />
						<html:hidden property="operation" styleId="operation" value="0" />
						<html:hidden property="page" value="2" />
						<div onclick="location.href='${URLBase}Flujos.do';" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Flows</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div onclick="document.getElementById( 'operation' ).value = 5; document.getElementById( 'FormaAgregar' ).submit( );" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Flow Tasks (${TareasOperationForm.nombreFlujo})</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div style="display: inline; color: black; font-size: 12px;"  >Edit Task (${TareasOperationForm.nombre})</div>
						<br/>
						<br/>
						<center>
						<div class='errors'>
						<html:errors/>
						<br/>
						${UserLogin.messageError}
						</div>
						
						<table class="TablaCatalogosNuevoTipoCuenta">
							<thead>
								<tr>
									<th>
										Existing Task
									</td>
								</tr>
							</thead>
							<tr>
								<td>
									<br/>
									<table class='TablaCatalogosFields' border="0" style="width: 650px;">
										<tr>
											<td class='TDLabel' style="width: 65%;">
												Name:
											</td>
											<td class='TDField' style="width: 35%;">
												<html:text property="nombre" styleClass='TextField' />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Description:
											</td>
											<td class='TDField'>
												<html:text property="descripcion" styleClass='TextField' />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Role:
											</td>
											<td class='TDField'>
												<html:select property="cveRole" styleClass="selectInput" onchange="document.getElementById( 'operation' ).value='24';document.getElementById( 'FormaAgregar' ).submit( ) ;">
													<html:option value="0">-- Select a role --</html:option>
													<html:options collection="Roles" labelProperty="nombre" property="cveRole" />
												</html:select>
												&nbsp;
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Level:
											</td>
											<td class='TDField'>
<c:if test="${Niveles ne NULL}">
												<html:select property="cveNivel" styleClass="selectInput">
													<html:option value="0">-- Select level --</html:option>
													<html:options collection="Niveles" labelProperty="nombre" property="cveNivel" />
												</html:select>
</c:if>
												&nbsp;
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Forms:
											</td>
											<td class='TDField'>
												<html:select property="cveForma" styleClass="selectInput">
													<html:option value="0">-- Select form --</html:option>
													<html:options collection="Formas" labelProperty="nombre" property="cveForma" />
												</html:select>
											</td>
										</tr>
										<tr>
											<td class='TDField' colspan="2" style="text-align: center;">
												Activation Date:
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Select activation date:
											</td>
											<td class='TDField'>
												<html:text readonly="true" property="activeDate" styleId="activeDate" styleClass="TextField" />
												<html:img src="images/icoCalendar.gif" styleClass="btnInputCal" styleId="activeDateImg" />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Or if you want to specify the number of days before or after any date:
											</td>
											<td class='TDField'>
												<html:text property="fechaActivacionDias" styleId="fechaActivacionDias" styleClass="TextField" style="width: 25px;" />
												<html:select property="fechaActivacionDate" styleClass="selectInput" style="display:inline;">
													<html:option value="0">-- Select an event --</html:option>
													<html:option value="1">Event</html:option>
													<html:option value="2">Delivery of BC</html:option>
													<html:option value="3">Approval of BC</html:option>
													<html:option value="4">Request quote</html:option>
													<html:option value="5">Purchase requisition</html:option>
													<html:option value="6">Upload contract</html:option>
													<html:option value="7">Upload First Billing Document</html:option>
													<html:option value="8">Confirmation of Venue</html:option>
													<html:option value="9">Campaign end</html:option>
													<html:option value="10">Upload Second Billing Document</html:option>
													<html:option value="11">Delivery of diary</html:option>
													<html:option value="12">Delivery of winners</html:option>
													<html:option value="13">Delivery of tickets</html:option>
													<html:option value="14">Travel out</html:option>
													<html:option value="15">Travel return</html:option>
													<html:option value="16">Evaluation</html:option>
												</html:select>
											</td>
										</tr>
										<tr>
											<td class='TDField' colspan="2" style="text-align: center;">
												Deadline to meet the task:
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Select the deadline:
											</td>
											<td class='TDField'>
												<html:text readonly="true" property="limitDate" styleId="limitDate" styleClass="TextField" />
												<html:img src="images/icoCalendar.gif" styleClass="btnInputCal" styleId="limitDateImg" />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Or if you want to specify the number of days before or after any date:
											</td>
											<td class='TDField'>
												<html:text property="fechaLimiteDias" styleId="fechaLimiteDias" styleClass="TextField" style="width:25px;" />
												<html:select property="fechaLimiteDate" styleClass="selectInput" style="display:inline;">
													<html:option value="0">-- Select an event --</html:option>
													<html:option value="1">Event</html:option>
													<html:option value="2">Delivery of BC</html:option>
													<html:option value="3">Approval of BC</html:option>
													<html:option value="4">Request quote</html:option>
													<html:option value="5">Purchase requisition</html:option>
													<html:option value="6">Upload contract</html:option>
													<html:option value="7">Upload First Billing Document</html:option>
													<html:option value="8">Confirmation of Venue</html:option>
													<html:option value="9">Campaign end</html:option>
													<html:option value="10">Upload Second Billing Document</html:option>
													<html:option value="11">Delivery of diary</html:option>
													<html:option value="12">Delivery of winners</html:option>
													<html:option value="13">Delivery of tickets</html:option>
													<html:option value="14">Travel out</html:option>
													<html:option value="15">Travel return</html:option>
													<html:option value="16">Evaluation</html:option>
												</html:select>
											</td>
										</tr>
                                                                                <tr>
                                                                                    <td class='TDLabel'>
												Execute task:
                                                                                    </td>
                                                                                    <td class='TDField'>
                                                                                        <c:if test="${TareasOperationForm.multiple eq 1}">
                                                                                            <input type="radio" name="multiple" id="multiple" value="1" CHECKED />&nbsp;Campaign
                                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                            <input type="radio" name="multiple" id="multiple" value="2" />&nbsp;Asset
                                                                                        </c:if>
                                                                                        <c:if test="${TareasOperationForm.multiple eq 2}">
                                                                                            <input type="radio" name="multiple" id="multiple" value="1" />&nbsp;Campaign
                                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                            <input type="radio" name="multiple" id="multiple" value="2" CHECKED />&nbsp;Asset
                                                                                        </c:if>
                                                                                        
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td class='TDLabel'>
												Task in microflow:
                                                                                    </td>
                                                                                    <td class='TDField'>
                                                                                        <c:if test="${TareasOperationForm.microFlujo eq 1}">
                                                                                            <input type="radio" name="microFlujo" id="microFlujo" value="1" CHECKED />&nbsp;No
                                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                            <input type="radio" name="microFlujo" id="microFlujo" value="2" />&nbsp;Si
                                                                                        </c:if>
                                                                                        <c:if test="${TareasOperationForm.microFlujo eq 2}">
                                                                                            <input type="radio" name="microFlujo" id="microFlujo" value="1" />&nbsp;No
                                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                            <input type="radio" name="microFlujo" id="microFlujo" value="2" CHECKED />&nbsp;Si
                                                                                        </c:if>
                                                                                        
                                                                                    </td>
                                                                                </tr>
										<tr>
											<td colspan='2' class='TDButton'>
												<html:submit value='Cancelar' onclick="document.getElementById( 'operation' ).value='5';return true ;" styleClass="ButtonSubmit" />
												&nbsp;
												<html:submit value='Guardar' onclick="document.getElementById( 'operation' ).value='6';return true ;" styleClass="ButtonSubmit" />
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
						</center>
						</html:form>
					</div>
					<div id="footContent"></div>
					<script type="text/javascript">//<![CDATA[
					var cal = Calendar.setup({
						cont          : "calendar-container",
						selectionType : Calendar.SEL_SINGLE,
						selection     : Calendar.dateToInt(new Date()),
						onSelect      : function() {
							this.hide( ) ;
						} , 
						onBlur		  : function( ) { this.hide( ) ; }
					});

					cal.manageFields("activeDateImg", "activeDate", "%d/%m/%Y");
					cal.manageFields("limitDateImg", "limitDate", "%d/%m/%Y");
					
					// da de alta en las diferentes fechas
					//]]></script>
<%}catch( Exception e )
{
out.print( e.getMessage( ) ) ;
}%>
<%
UserLogin user = ( UserLogin ) session.getAttribute( "UserLogin" ) ;
user.clearMessageError( ) ;
%>